using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ShootThemUp.Sources.GameElements.Weapons;
using Microsoft.Xna.Framework;

namespace ShootThemUp.Sources.GameElements.Ships.Ennemies.Fruits
{
    public class Fruit : Ship
    {

        #region Fields

        /// <summary>
        /// The score earned by the player when he destroys the fruit.
        /// </summary>
        private int scoreValue;

        private int positionInTheWave;

        private bool spawn = false;


        #endregion

        #region Properties

        /// <summary>
        /// Gets or sets the score value of this fruit.
        /// </summary>
        /// <value>
        /// The score value of this fruit.
        /// </value>
        public int ScoreValue {
            get { return this.scoreValue; }
            set { this.scoreValue = value; }
        }

        public int PositionInTheWave
        {
            get { return positionInTheWave; }
            set { positionInTheWave = value; }
        }

        /// <summary>
        /// Gets or sets a value indicating whether this <see cref="Fruit"/> is spawn.
        /// </summary>
        /// <value>
        ///   <c>true</c> if spawn; otherwise, <c>false</c>.
        /// </value>
        public bool Spawn
        {
            get { return spawn; }
            set { spawn = value; }
        }

        #endregion

        #region Constructor

        public Fruit(int life, Weapon weapon, int scoreValue)
            : base(life, weapon)
        {
            this.scoreValue = scoreValue;            
        }

        public Fruit(int life, Weapon weapon, int scoreValue, Vector2 position,Vector2 speed, Rectangle? sourceRectangle, Rectangle? hitbox) 
            : base(life,weapon,position,speed,sourceRectangle,hitbox)
        {
            this.scoreValue = scoreValue;         
        }

        #endregion 

        #region Update

        public override void Update(GameTime gameTime)
        {
            this.Speed = Vector2.Zero; // The speed is zero because each fruit follow the trajectory of the wave. So the wave set directly the next fruit position in function of the trajectory.
            base.Update(gameTime);
        }
        #endregion
    }
}
